package com.his.patiinfobasic.controller;

import com.his.config.annotation.CurrentUser;
import com.his.login.entity.DictEmployee;
import com.his.patiinfobasic.vo.PatiinfobasicContactorVo;
import com.his.sysconfig.service.SysconfigService;
import com.his.sysconfig.vo.SysconfigVo;
import com.xiao.common.controller.ResultBaseController;
import com.xiao.common.util.ResultUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author xiaoxiaoping
 * @Date 2020/2/6 11:21
 * @Version 1.0
 */
@Controller
@RequestMapping(value="/api/contract")
public class PatiinfobasicContactorController extends ResultBaseController {

    private  final Logger logger = (Logger) LoggerFactory.getLogger(this.getClass());
    @Resource
    private SysconfigService sysconfigService;

    @ResponseBody
    @PostMapping(value = "/save.do")
    public ResultUtil save(@CurrentUser DictEmployee dictEmployee,@RequestBody @Validated PatiinfobasicContactorVo patiinfobasicContactorVo){
        try{
            //sysconfigService.save(patiinfobasicContactorVo,dictEmployee);
            return this.success("保存成功！",null);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
            return this.fail(e.getMessage(),null);
        }

    }

    @ResponseBody
    @PostMapping(value = "/update.do")
    public ResultUtil update(@Validated PatiinfobasicContactorVo patiinfobasicContactorVo){
        try{
            //sysconfigService.update(patiinfobasicContactorVo);
            return this.success("修改成功！",null);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
            return this.fail(e.getMessage(),null);
        }

    }
}
